import './assets/main.css'

import { createApp } from 'vue'
import { createPinia } from 'pinia'
import { init } from '@module-federation/runtime'

// window.useCounterStore
import './stores/counter'
import App from './App.vue'
import router from './router'

const app = createApp(App)

init({
  name: 'host',
  remotes: [
    {
      name: 'remote-a',
      type: 'module',
      entry: 'http://localhost:3000/remoteEntry.js',
    },
    {
      name: 'remote-b',
      type: 'module',
      entry: 'http://localhost:3001/remoteEntry.js',
    },
  ],
  shared: {
    vue: {
      shareConfig: {
        singleton: true,
        requiredVersion: '^3.5.13',
      },
    },
    echarts: {
      shareConfig: {
        singleton: true,
        requiredVersion: '^5.6.0',
      },
    },
  },
})
app.use(createPinia())
app.use(router)

app.mount('#app')
